<?php

namespace App\Http\Requests;

/**
 * @OA\Schema(
 *     required={"name","images","price","category_id","content"}
 * )
 */
class SecondGoodRequest extends BaseRequest
{
    /**
     * @OA\Property(property="good_id", format="string", description="商品ID,新增时候默认填0", default="0"),
     * @OA\Property(property="name", format="string", description="商品名称", default=""),
     * @OA\Property(property="images", format="string", description="商品图片组", default=""),
     * @OA\Property(property="price", format="string", description="商品价格", default=""),
     * @OA\Property(property="category_id", format="string", description="商品分类",  default="")
     * @OA\Property(property="content", format="string", description="商品详情",  default="")
     */
    public function rules(): array
    {
        return [
            'good_id' => [],
            'name' => ['required'],
            'images' => ['required'],
            'price' => ['required'],
            'category_id' => ['required'],
            'content' => ['required'],
        ];
    }


    public function messages(): array
    {
        return [
            'name.required'=>'商品名称不能为空!',
            'images.required'=>'商品图片组不能为空!',
            'price.required'=>'商品价格不能为空!',
            'category_id.required'=>'商品分类不能为空!',
            'content.required'=>'商品详情不能为空!'
        ];
    }
}
